
message ("-- Looking for NVidia Cg-Toolkit")

if(WIN32)
  find_path(NV_CG_INCLUDE_DIR
            NAMES Cg/cg.h
            HINTS $ENV{CG_INC_PATH}
            )
  
  find_library (NV_CG_LIBRARIES
                NAMES Cg
                HINTS $ENV{CG_LIB_PATH}
                )

  find_library (NV_CG_LIBRARIES_GL
                NAMES CgGL
                HINTS $ENV{CG_LIB_PATH}
                )

else()
  #find the include directory
  find_path (NV_CG_INCLUDE_DIR
            NAMES Cg/cg.h
            )


  find_library (NV_CG_LIBRARIES
                NAMES Cg
                )

  find_library (NV_CG_LIBRARIES_GL
                NAMES CgGL
                )
endif()

set (NV_CG_FOUND "NO")

if (NV_CG_LIBRARIES)
  if (NV_CG_LIBRARIES_GL)
    set (NV_CG_LIBRARIES ${NV_CG_LIBRARIES} ${NV_CG_LIBRARIES_GL})
    set (NV_CG_FOUND "YES")
  endif()
endif()

if (NV_CG_FOUND)
  message ("-- Looking for NVidia Cg-Toolkit - found")
elseif()
  message ("-- Looking for NVidia Cg-Toolkit - not found")
endif()
